package cn.nnxy.zentao.service.impl;

import cn.nnxy.zentao.domain.ZPlan;
import cn.nnxy.zentao.mapper.ZPlanMapper;
import cn.nnxy.zentao.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PlanServiceImpl implements PlanService {

    @Autowired
    private ZPlanMapper planMapper;

    @Override
    public List<ZPlan> queryList(){
        return null;
    }

    @Override
    public int updateById(ZPlan plan) {
        if (null == plan || plan.getPlanId() == null) {
            return 0;
        }
        return planMapper.updateById(plan);
    }

    @Override
    public ZPlan seletById(Integer id) {
        if (null == id) {
            return null;
        }
        return planMapper.selectById(id);
    }

    @Override
    public int savePlan(ZPlan plan) {
        if (null == plan) {
            return 0;
        }
        return planMapper.insert(plan);
    }

    @Override
    public int deleteById(Integer[] planIds) {
        if (null == planIds || planIds.length == 0){
            return 0;
        }
        return planMapper.deleteById(planIds);
    }

}
